package com.flashcash.solu.view.me;

import android.view.View;
import android.widget.ImageButton;
import android.widget.TextView;

import com.flashcash.solu.R;
import com.flashcash.solu.app.base.BaseActivity;
import com.flashcash.solu.view.me.presenter.AboutActPresenter;
import com.flashcash.solu.view.me.presenter.AboutPreImp;
import com.flashcash.kotlin.data.DisplayBean;

import butterknife.BindView;

/**
 * Created by Miaoke on 2017/3/13.
 */

public class AboutActivity extends BaseActivity<AboutActPresenter> implements View
        .OnClickListener, AboutView {
    @BindView(R.id.id_imagebutton_info_list)
    ImageButton mIdImagebuttonInfoList;
    @BindView(R.id.id_imagebutton_back)
    ImageButton mIdImagebuttonBack;

    @BindView(R.id.id_textview_title)
    TextView mIdTextviewTitle;

    @BindView(R.id.tv_about)
    TextView mTvAbout;

    @Override
    protected int getLayoutResId() {
        return R.layout.activity_about;
    }

    @Override
    protected void init() {
        mIdImagebuttonInfoList.setVisibility(View.GONE);
        mIdImagebuttonBack.setOnClickListener(this);
        String topTitle = getResources().getText(R.string.text_title_about).toString();
        mIdTextviewTitle.setText(topTitle);
        mPresenter.requestDisplay();
    }

    @Override
    protected AboutActPresenter initPresenterImpl() {
        return new AboutPreImp();
    }

    @Override
    public void onClick(View v) {
        int id = v.getId();
        switch (id) {
            case R.id.id_imagebutton_back:
                finish();
                break;
        }
    }

    @Override
    public void responseDisplay(DisplayBean displayBean) {
       // mTvAbout.setText(displayBean.getDescription());
    }

    @Override
    public void responseDisplayEmpty() {
        mTvAbout.setText(R.string.text_about_company_detail);
    }
}
